package org.ch03.job.test01;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

/**
 * @author XCH
 * @date 2025 - 03 - 25
 */
public class MainTest {
    public <T> T TClass(Class<T> clazz) throws Exception {
        Constructor<T> constructor = clazz.getDeclaredConstructor();
        return constructor.newInstance();

    }
    public static void main(String[] args) throws Exception {
        MainTest method = new MainTest();
        User<String> user = method.TClass(User.class);
        user.setDate("张三");
        String date = user.getDate();
        System.out.println(date);
    }
}
